<template>
  <div>
    <input :type="type" :value="value" @input="onInput" />
  </div>
</template>

<script>
export default {
  props: {
    value: {
      type: String,
      default: "",
    },
    type: {
      type: String,
      default: "text",
    },
  },
  methods: {
    onInput(e) {
      //派发事件
       console.log(2222222222)
      console.log(e.target.value)
      this.$emit("input", e.target.value);
      this.$parent.$emit('validate')
    },
  },
};
</script>

<style scoped lang='scss'>
</style>
